#ifndef BULLET_H
#define BULLET_H

#include "Object.h"
#include "Mob.h"

#include <iostream>
#include <fstream>

using namespace std;

class Bullet : public Object
{
    public:
        static const char BULLETCHAR = '*';
        static const int DMGVALUE = 1;

        Bullet( int x_ = -1, int y_ = -1, Field* f_ = 0, bool status = true,
                        Direction dir = NORTH, int speed_ = 5, int lastUpdate_ = 0 )
            :Object( x_, y_, f_, status ), direction(dir), speed(speed_), lastUpdate(lastUpdate_)
        {}

        void update( int updateNumber );
        char getSymbol() const { return BULLETCHAR; }

        Direction getDirection() const { return direction; }
        int getSpeed() const { return speed; }
        int getLastUpdate() const{ return lastUpdate; }

        void setDirection( Direction i ){ direction = i; }
        void setSpeed( int i ){ speed = i; }
        void setLastUpdate( int i ){ lastUpdate = i; }

        void save( ofstream* save, ofstream* config );
    protected:
    private:
        Direction direction;

        int speed;
          // used to prevent multymoving at single update
        int lastUpdate;
};

#endif // BULLET_H
